| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | /** global: jest */ |
||
| 7 | describe('Index routes.', () => { |
||
| 8 | test('POST plain text into page with certain streamId', (done) => { |
||
| 9 | const response = { status: jest.fn(), send: () => done() }; |
||
| 10 | |||
| 11 | router.handle(plainRequest, response); |
||
| 12 | }); |
||
| 13 | |||
| 14 | test('POST JSON data into page with certain streamId', (done) => { |
||
| 15 | const response = { status: jest.fn(), send: jest.fn() }; |
||
| 16 | global.socket = { |
||
| 17 | emit: (type, data) => { |
||
| 18 | expect(type).toBe('log'); |
||
| 19 | expect(typeof data).toBe('object'); |
||
| 20 | done(); |
||
| 21 | }, |
||
| 22 | }; |
||
| 23 | |||
| 24 | router.handle(jsonRequest, response); |
||
| 25 | }); |
||
| 26 | }); |
||
| 27 |